new Vue({
    el: "#app",
    data: {
        meng: "Hello vue"
    },
    mounted() {
        axios
            .get('../json/json.json')
            .then(response => this.meng = response.data.urls)
            .catch(function (error) {
                console.log(error);
            })
    }
});

new Vue({
    el: "#aee",
    data: {
        meng: "Hello vue"
    },
    mounted() {
        axios
            .get('../json/json.json')
            .then(response => this.meng = response.data.ftr)
            .catch(function (error) {
                console.log(error);
            })
    }
});

//导航部分
var dt_nav_btn=document.querySelector("#dt-nav-btn");
var dt_nav_content=document.querySelector("#dt-nav-content");

dt_nav_btn.addEventListener("mouseover",function(){
    dt_nav_content.style.display="block";
});
dt_nav_btn.addEventListener("mouseleave",function(){
    dt_nav_content.style.display="none";
});
dt_nav_content.addEventListener("mouseover",function(){
    dt_nav_content.style.display="block";
});
dt_nav_content.addEventListener("mouseleave",function(){
    dt_nav_content.style.display="none";
});
//搜索框
var ss=document.querySelector("#ss");
var sj=document.querySelector("#sj");
var ts=document.querySelector("#ts");
ss.addEventListener("click",function(){
    ts.style.display="none";
});
sj.addEventListener("mouseover",function(){
    ts.style.display="block"
});

//底部部分
var share_wechat=document.querySelector("#share-wechat");
var wechat1=document.querySelector("#wechat");
share_wechat.addEventListener("mouseover",function(){
    wechat1.style.display="block";
});
share_wechat.addEventListener("mouseleave",function(){
    wechat1.style.display="none";
});
var share_tribal=document.querySelector("#share-tribal");
var qq_tribal_code=document.querySelector("#qq-tribal-code");
share_tribal.addEventListener("mouseover",function(){
    qq_tribal_code.style.display="block";
});
share_tribal.addEventListener("mouseleave",function(){
    qq_tribal_code.style.display="none";
});

//返回顶部
var floating=document.querySelector("#floating-social-bar");
var goTop=document.querySelector("#btn-goTop");

window.onscroll=function(){
    if (document.documentElement.scrollTop>200||document.body.scrollTop>200){
        floating.style.display='block';
    }else {
        floating.style.display='none';
    }
    if(document.documentElement.scrollTop>1000||document.body.scrollTop>1000){
        floating.classList.add("db-dw")
    }else {
        floating.classList.remove("db-dw")
    }
};

goTop.addEventListener('click',function(){
//    婊氬埌鎸囧畾浣嶇疆
//    window.scrollTo(0,0);
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});
